<?php
require_once 'inc.php';

$image = get_image_from_file($_REQUEST['f']);
$image_s = imagecreatetruecolor(REC_SIZE*SCALE*3, REC_SIZE*SCALE);

imagecopyresampled($image_s, $image, 0, 0, 0, 0,
	REC_SIZE*SCALE, REC_SIZE*SCALE, imagesx($image), imagesy($image));

$image_p = imagecreatetruecolor(REC_SIZE, REC_SIZE);
imagecopyresampled($image_p, $image, 0, 0, 0, 0,
	REC_SIZE, REC_SIZE, imagesx($image), imagesy($image));
imagecopyresized($image_s, $image_p, REC_SIZE*SCALE, 0, 0, 0,
	REC_SIZE*SCALE, REC_SIZE*SCALE, REC_SIZE, REC_SIZE);

$image_p = imagecreatetruecolor(REC_SIZE, REC_SIZE);
imagecopyresized($image_p, $image, 0, 0, 0, 0,
	REC_SIZE, REC_SIZE, imagesx($image), imagesy($image));
imagecopyresized($image_s, $image_p, REC_SIZE*SCALE*2, 0, 0, 0,
	REC_SIZE*SCALE, REC_SIZE*SCALE, REC_SIZE, REC_SIZE);



header('Content-type: image/jpeg');
imagejpeg($image_s);
